package com.study.test3;

import lombok.AllArgsConstructor;
import lombok.Data;

public class heapstack1 {

    public static void main(String[] args) {
        Integer i1 = 1;
        String i2 = "hello ";
        C1 c3 = new C1("ytt");
        updateInt(i1);
        System.out.println(i1);
        updateString(i2);
        updateObj(c3);
//        System.out.println(c3);
        System.out.println(i2);
    }

    public static void updateInt(Integer id){
        id = id+1;//值传递
    }
    public static void updateString(String id){
        id = id+"update";
        System.out.println(id);
    }

    public static void updateObj(C1 c1){
//        c1.setName(c1.getName()+"update");
        System.out.println(c1);
    }
}

@Data
@AllArgsConstructor
class C1{

    private String name;
}
